package udpEcho;

import java.io.IOException;
import java.net.SocketException;
import java.util.HashMap;
import java.util.Map;

public class DicServer extends Server{
    public Map<String,String> map = new HashMap<String,String>();
    public DicServer(int port) throws SocketException {
        super(port);
        map.put("hello","你好");
        map.put("good","好的");
        map.put("bad","坏的");
    }
    @Override
    public String  process(String request){
        return map.getOrDefault(request,"没有你要找的单词");
    }

    public static void main(String[] args) throws IOException {
        DicServer dicServer = new DicServer(1010);
        dicServer.start();
    }
}
